package com.wyy.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wyy.beans.Role;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface RoleDao extends BaseMapper<Role> {

    @Select("select * from role r left join user_role ur on r.rid = ur.role_id where ur.user_id = #{userId}")
    List<Role> getRolesByUserId(long userId);
}
